package com.ruoyi.comment.service.impl;

import java.util.List;

import com.ruoyi.comment.domain.CommerceInfoComment;
import com.ruoyi.comment.mapper.CommerceInfoCommentMapper;
import com.ruoyi.comment.service.ICommerceInfoCommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 帮养之家和评论关联Service业务层处理
 * 
 * @author zhezhi
 * @date 2022-10-05
 */
@Service
public class CommerceInfoCommentServiceImpl implements ICommerceInfoCommentService
{
    @Autowired
    private CommerceInfoCommentMapper commerceInfoCommentMapper;

    /**
     * 查询帮养之家和评论关联
     * 
     * @param commerceId 帮养之家和评论关联主键
     * @return 帮养之家和评论关联
     */
    @Override
    public CommerceInfoComment selectCommerceInfoCommentByCommerceId(Long commerceId)
    {
        return commerceInfoCommentMapper.selectCommerceInfoCommentByCommerceId(commerceId);
    }


    /**
     * 查询帮养之家和评论关联(根据评论Id进行查询)
     *
     * @param comment
     * @return 帮养之家和评论关联
     */
    @Override
    public CommerceInfoComment selectCommerceInfoCommentByCommentId(Long comment)
    {
        CommerceInfoComment commerceInfoComment = commerceInfoCommentMapper.selectCommerceInfoCommentByCommentId(comment);
//        System.out.println(commerceInfoComment);
        return commerceInfoComment;
    }



    /**
     * 查询帮养之家和评论关联列表
     * 
     * @param commerceInfoComment 帮养之家和评论关联
     * @return 帮养之家和评论关联
     */
    @Override
    public List<CommerceInfoComment> selectCommerceInfoCommentList(CommerceInfoComment commerceInfoComment)
    {
        return commerceInfoCommentMapper.selectCommerceInfoCommentList(commerceInfoComment);
    }

    /**
     * 新增帮养之家和评论关联
     * 
     * @param commerceInfoComment 帮养之家和评论关联
     * @return 结果
     */
    @Override
    public int insertCommerceInfoComment(CommerceInfoComment commerceInfoComment)
    {
        return commerceInfoCommentMapper.insertCommerceInfoComment(commerceInfoComment);
    }

    /**
     * 修改帮养之家和评论关联
     * 
     * @param commerceInfoComment 帮养之家和评论关联
     * @return 结果
     */
    @Override
    public int updateCommerceInfoComment(CommerceInfoComment commerceInfoComment)
    {
        return commerceInfoCommentMapper.updateCommerceInfoComment(commerceInfoComment);
    }


    /**
     * 修改帮养之家和评论关联(根据评论Id去进行修改)
     *
     * @param commerceInfoComment 帮养之家和评论关联
     * @return 结果
     */
    @Override
    public int updateCommerceInfoCommentByCommentId(CommerceInfoComment commerceInfoComment)
    {
        return commerceInfoCommentMapper.updateCommerceInfoCommentByCommentId(commerceInfoComment);
    }



    /**
     * 批量删除帮养之家和评论关联
     * 
     * @param commerceIds 需要删除的帮养之家和评论关联主键
     * @return 结果
     */
    @Override
    public int deleteCommerceInfoCommentByCommerceIds(Long[] commerceIds)
    {
        return commerceInfoCommentMapper.deleteCommerceInfoCommentByCommerceIds(commerceIds);
    }

    /**
     * 删除帮养之家和评论关联信息
     * 
     * @param commerceId 帮养之家和评论关联主键
     * @return 结果
     */
    @Override
    public int deleteCommerceInfoCommentByCommerceId(Long commerceId)
    {
        return commerceInfoCommentMapper.deleteCommerceInfoCommentByCommerceId(commerceId);
    }
}
